<template>
    <div style="width: 300px;">
        <el-form label-width="100px" size="small">
            <!-- <el-form-item label="首页跳转地址">
                <el-input v-model="data.indexHref"></el-input>
            </el-form-item>
            <el-form-item label="host">
                <el-input v-model="data.host"></el-input>
            </el-form-item> -->
            <!-- <el-form-item label="隐藏导航菜单">
                <el-switch v-model="data.hideMenu" active-color="#13ce66"></el-switch>
            </el-form-item> -->
            <el-form-item label="颜色">
                <el-color-picker v-model="data.background_color" style="float: right;"></el-color-picker>
                <el-input v-model="data.background_color" readonly style="width: 80%;"></el-input>
                <!-- <el-input v-model="data.background_color"></el-input> -->
            </el-form-item>
            <el-form-item size="small" align="right">
                <el-button type="primary" @click="onSave">保存</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>
<script>
import {axget,axpost} from '@/components/api/index'
export default {
    data(){
        return {
            data: {}
        }
    },
    created(){
        this.onLoad()
    },
    methods:{
        onLoad(){
            axpost('/config',{}).then(r=>{
                // r.hideMenu = this.hideMenu(r.hideMenu)
                this.data = r
                
            })
        },
        onSave(){
            console.log(axpost('/config/modify',this.data))
            // axpost('/config/modify',this.data).then(r=>{
            //     // if(r.status === 200 && r.data.status === 200){
            //     //     this.$message.success('保存成功')
            //     // }else{
            //     //     this.$message.warning('保存失败')
            //     // }
            // })
        },
        hideMenu(val){
            if(val === 'true') return true
            else return false
        }
    }
}
</script>